Socket
Socket
Sign inDemoInstall

dashify

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dashify

Convert a camelcase or space-separated string to a dash-separated string.


Version published
Weekly downloads
430K
increased by8.31%
Maintainers
1
Install size
5.53 kB
Created
Weekly downloads
 

Readme

Source

dashify NPM version Build Status

Convert a camelcase or space-separated string to a dash-separated string.

I'm using this for converting object keys to dash-case. Most slugify libs are too heavy for this, so I made this as a fast and light alternative.

Install

Install with npm:

$ npm install dashify --save

Usage

var dashify = require('dashify');

dashify('fooBar');
//=> 'foo-bar'
dashify('fooBarBaz');
//=> 'foo-bar-baz'
dashify('foo bar');
//=> 'foo-bar'
dashify('foo barBaz');
//=> 'foo-bar-baz'
dashify('foo barBaz quux');
//=> 'foo-bar-baz-quux'

Some other awesome string libs:

  • pascalcase: Convert a string to pascal-case. | homepage
  • romanize: Convert arabic numbers to roman numerals (useful for books, outlines, documentation, slide decks, etc) | homepage
  • word-wrap: Wrap words to a specified length. | homepage
  • wordcount: Count the words in a string. Support for english, CJK and Cyrillic. | homepage

Running tests

Install dev dependencies:

$ npm install -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

If this project doesn't do what you need, please let us know!

Author

Jon Schlinkert

License

Copyright © 2015-2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on May 23, 2016.

Keywords

FAQs

Last updated on 23 May 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc